home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / PDFindPageSize.z / PDFindPageSize
Text File  |  1998-10-30  |  10KB  |  199 lines

  1.  
  2.  
  3.  
  4. PPPPDDDDFFFFiiiinnnnddddPPPPaaaaggggeeeeSSSSiiiizzzzeeee((((3333))))                IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo                 PPPPDDDDFFFFiiiinnnnddddPPPPaaaaggggeeeeSSSSiiiizzzzeeee((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      PDFindPageSize, PDGetSizeCodeByName, PDGetNameBySizeCode - page size
  10.      convenience functions
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ppppoooodddd....hhhh>>>>
  14.  
  15.      PPPPDDDDSSSSiiiizzzzeeeeTTTTaaaabbbblllleeeeSSSSttttrrrruuuucccctttt**** PPPPDDDDFFFFiiiinnnnddddPPPPaaaaggggeeeeSSSSiiiizzzzeeee((((PPPPDDDDIIIInnnnffffooooSSSSttttrrrruuuucccctttt ****iiiinnnnffffoooo,,,,
  16.                                        iiiinnnntttt ssssiiiizzzzeeee____ccccooooddddeeee))));;;;
  17.  
  18.      iiiinnnntttt PPPPDDDDGGGGeeeettttSSSSiiiizzzzeeeeCCCCooooddddeeeeBBBByyyyNNNNaaaammmmeeee((((cccchhhhaaaarrrr ****ssssiiiizzzzeeee____nnnnaaaammmmeeee))));;;;
  19.  
  20.      cccchhhhaaaarrrr**** PPPPDDDDGGGGeeeettttNNNNaaaammmmeeeeBBBByyyySSSSiiiizzzzeeeeCCCCooooddddeeee((((iiiinnnntttt ssssiiiizzzzeeee____ccccooooddddeeee))));;;;
  21.  
  22. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  23.      _P_D_F_i_n_d_P_a_g_e_S_i_z_e, _P_D_G_e_t_S_i_z_e_C_o_d_e_B_y_N_a_m_e and _P_D_G_e_t_N_a_m_e_B_y_S_i_z_e_C_o_d_e are
  24.      convenience functions for specifying and querying page size information.
  25.  
  26.      _P_D_F_i_n_d_P_a_g_e_S_i_z_e is a convenience function for determining whether a given
  27.      media size is supported on a given printer. This function is especially
  28.      useful for obtaining information about the currently loaded media.
  29.  
  30.      _P_D_F_i_n_d_P_a_g_e_S_i_z_e searches the page size table of the specified _P_D_I_n_f_o_S_t_r_u_c_t
  31.      for the page size specified by _s_i_z_e__c_o_d_e. _i_n_f_o may be obtained with a
  32.      call to either _P_D_L_o_c_a_l_R_e_a_d_I_n_f_o or _P_D_R_e_a_d_I_n_f_o. The values for _s_i_z_e__c_o_d_e
  33.      are all designated PPPPDDDD____SSSSIIIIZZZZEEEE____[[[[ssssiiiizzzzeeee nnnnaaaammmmeeee]]]] and can be found in _p_o_d._h.  Of
  34.      particular interest is the value PPPPDDDD____SSSSIIIIZZZZEEEE____CCCCUUUURRRRRRRREEEENNNNTTTT. Specifying this value
  35.      returns the currently loaded media size information.
  36.  
  37.      Often a page size is provided to an application as a name (e.g. "A4").
  38.      However, most _l_i_b_p_o_d functions require a page size code rather than a
  39.      page name string. The _P_D_G_e_t_S_i_z_e_C_o_d_e_B_y_N_a_m_e function provides the page size
  40.      code corresponding to the specified page size name. The complete list of
  41.      page size names and codes can be found in _p_o_d._h.
  42.  
  43.      The _P_D_G_e_t_N_a_m_e_B_y_S_i_z_e_C_o_d_e function performs the inverse operation of
  44.      _P_D_G_e_t_S_i_z_e_C_o_d_e_B_y_N_a_m_e. The page size name string corresponding to the
  45.      specified page size code is returned.  The complete list of page size
  46.      names and codes can be found in _p_o_d._h.
  47.  
  48.      The _P_D_S_i_z_e_T_a_b_l_e_S_t_r_u_c_t is defined as follows.
  49.  
  50.           typedef struct _pdSizeTableStruct {
  51.               int   media_size;         /* Generic media name token */
  52.               int   horizontal_addr;    /* Horizontal dots */
  53.               int   vertical_addr;      /* Vertical dots */
  54.               float width;              /* Width in inches */
  55.               float length;             /* Length in inches */
  56.               float left_margin;        /* Left margin in inches */
  57.               float top_margin;         /* Top margin in inches */
  58.               char  raster_definition;  /* Raster direction and */
  59.                                         /* orientation bits */
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. PPPPDDDDFFFFiiiinnnnddddPPPPaaaaggggeeeeSSSSiiiizzzzeeee((((3333))))                IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo                 PPPPDDDDFFFFiiiinnnnddddPPPPaaaaggggeeeeSSSSiiiizzzzeeee((((3333))))
  71.  
  72.  
  73.  
  74.               char  validation_mask;    /* Entry validation */
  75.               char  variable_page_size; /* Variable width or length bits */
  76.           } PDSizeTableStruct;
  77.  
  78.  
  79.      _m_e_d_i_a__s_i_z_e          Media size code (see _p_o_d._h).
  80.  
  81.      _h_o_r_i_z_o_n_t_a_l__a_d_d_r, _v_e_r_t_i_c_a_l__a_d_d_r
  82.                          Number of horizontal and vertical dots. This is also
  83.                          the length of each raster line and the number of
  84.                          raster lines, respectively.
  85.  
  86.      _w_i_d_t_h               Width of the medium in inches along the raster line.
  87.  
  88.      _l_e_n_g_t_h              Length of the medium in inches perpendicular to the
  89.                          raster line.
  90.  
  91.      _l_e_f_t__m_a_r_g_i_n         Non-printable distance in inches to the left of each
  92.                          raster line.
  93.  
  94.      _t_o_p__m_a_r_g_i_n          Non-printable distance in inches before the first
  95.                          raster line.
  96.  
  97.      _r_a_s_t_e_r__d_e_f_i_n_i_t_i_o_n   Code describing the direction and orientation of the
  98.                          printer raster (see _p_o_d._h).
  99.  
  100.      _v_a_l_i_d_a_t_i_o_n__m_a_s_k     Size table entry validation bit mask.
  101.  
  102.      _v_a_r_i_a_b_l_e__p_a_g_e__s_i_z_e  Variable page size code (see _p_o_d._h).
  103.  
  104. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
  105.      _P_D_F_i_n_d_P_a_g_e_S_i_z_e returns a pointer to a PDSizeTableStruct if the page size
  106.      specified by _s_i_z_e__c_o_d_e is found. Note that the pointer returned points
  107.      into the specified _P_D_I_n_f_o_S_t_r_u_c_t and should not be freed. Also note that
  108.      this pointer will become invalid upon subsequent calls to _P_D_L_o_c_a_l_R_e_a_d_I_n_f_o
  109.      and _P_D_R_e_a_d_I_n_f_o. If the specified page size is not found or an execution
  110.      error occurs, NULL is returned and _P_D_e_r_r_n_o will be set. Test the value of
  111.      _P_D_e_r_r_n_o to determine whether an execution error occurred or the page size
  112.      was not found (see Execution Error Codes below).
  113.  
  114.      _P_D_G_e_t_S_i_z_e_C_o_d_e_B_y_N_a_m_e returns the page size code corresponding to the
  115.      specified page size name. If an execution error occurs or the page name
  116.      cannot be found, -1 is returned and _P_D_e_r_r_n_o will be set. To distinguish
  117.      between execution error and name not found test the value of _P_D_e_r_r_n_o.
  118.  
  119.      _P_D_G_e_t_N_a_m_e_B_y_S_i_z_e_C_o_d_e always returns a pointer to a page name string. If
  120.      the size code is invalid, an empty string may be returned. Note that the
  121.      pointer returned points to library static storage. To preserve the name
  122.      string across subsequent calls to the function, copy the string to caller
  123.      allocated storage.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. PPPPDDDDFFFFiiiinnnnddddPPPPaaaaggggeeeeSSSSiiiizzzzeeee((((3333))))                IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo                 PPPPDDDDFFFFiiiinnnnddddPPPPaaaaggggeeeeSSSSiiiizzzzeeee((((3333))))
  137.  
  138.  
  139.  
  140. EEEEXXXXEEEECCCCUUUUTTTTIIIIOOOONNNN EEEERRRRRRRROOOORRRR CCCCOOOODDDDEEEESSSS
  141.      _P_D_F_i_n_d_P_a_g_e_S_i_z_e will fail under the following circumstances.
  142.  
  143.      PD_LIBERR_NO_PAGESIZE    Page size corresponding to the specified page
  144.                               size code could not be found.
  145.  
  146.      PD_LIBERR_BAD_STRUCT     A NULL structure pointer has been specified.
  147.  
  148.      _P_D_G_e_t_S_i_z_e_C_o_d_e_B_y_N_a_m_e will fail under the following circumstances.
  149.  
  150.      PD_LIBERR_NO_PAGECODE    Page size code corresponding to the specified
  151.                               page size name could not be found.
  152.  
  153.      PD_LIBERR_BAD_SIZENAME   Page size name is a NULL pointer.
  154.  
  155.      _P_D_G_e_t_N_a_m_e_B_y_S_i_z_e_C_o_d_e always returns a pointer to a string.
  156.  
  157. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  158.      PDReadInfo(3), libpod(3)
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.